﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CrmValueTask.aspx.cs" Inherits="ZX.WebApp.Crm.Modules.CrmValueTask" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../../Styles/base.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/extend.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/treeview/treeview-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
</head>
<body class="yui-skin-sam">
    <form id="form1" runat="server">
    <div id="toolbar" style="margin-top: 5px; text-align: center;">
        <%if (Flag != "0" && strView == "")
          { %>
            &nbsp; <span style="color: Red;font-size:large"><b>退回原因：*</b></span>&nbsp;
            <input type="text" id="backReason" title="不超过200个汉字" maxlength="200" style="width: 260px;" />
        <%} %>
        <button type="button" id="btnSave" name="btnSave">
            提交</button>
        <button type="button" id="btnQdnx" name="btnQdnx">
            提交</button>
        <button type="button" id="btnNxja" name="btnNxja">
            提交</button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" id="btnClose" name="btnClose">
            退回给客户经理</button>
        <asp:Button ID="btnAccept" runat="server" Text="知道了" Visible="false" CssClass="btnCheck"
            OnClick="btnAccept_Click" UseSubmitBehavior="False" />
    </div>
    <div class="fieldForm" id="fieldForm">
        <div id="content">
            <h3>
                客户基本信息</h3>
            <table class="table1">
                <tr>
                    <th width="18%">
                        <span style="color: Red">*</span><span>客户名称</span>
                    </th>
                    <td colspan="3">
                        <input type="hidden" id="CustomerID" name="CustomerID" runat="server" />
                        <input type="text" id="CustomerName" runat="server" name="CustomerName" readonly="readonly"
                            class="width30" />
                        <button id="btnCustomerID" name="FV" type="button" onclick="change('1')" runat="server"
                            class="btnCheck" style="height: 25px;">
                            选择</button>
                       
                        <span style="color: Red">如有两个客户名称，请写入备注说明</span>
                    </td></tr>
                <tr>
                    <th width="18%">
                        <span>客户类型</span>
                    </th>
                    <td width="32%">
                        <input id="cType" type="text" runat="server" style="background: #e7eaf4;" disabled="disabled" />
                    </td>
                    <th width="18%">
                        <span>企业产值</span>
                    </th>
                    <td width="32%">
                        <input type="text" id="CValue" name="CValue" runat="server" style="background: #e7eaf4;"
                            disabled="disabled" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <span style="color: Red">*</span>
                   
                        <input type="hidden" id="Memember" runat="server" />
                        <input type="hidden" id="txtMemember" runat="server" dtype="Z" disabled="disabled"
                            style="width: 92%" />
                        <button id="btnMemember" name="rv" type="button" runat="server" onclick="change('2')"
                            class="btnCheck">
                            选择产品名称</button>
                    </td> 
                </tr>
                <tr id="es">
                    <td colspan="4">
                        <table id="table1">
                            <tr>
                            <th style="text-align:center">
                                    产品包
                                </th>
                                <th style="text-align:center">
                                    产品名称
                                </th>
                                <th style="text-align:center">
                                    数量
                                </th>
                                <th style="text-align:center">
                                    销售渠道
                                </th>
                                <th style="text-align:center;width:150px;">
                                    回款金额（单位：元）
                                </th>
                                <th style="text-align:center">
                                    回款日期
                                </th>
                            </tr>
                        </table>
                    </td>
                </tr>
                
                <tr><th>
                        <span>申请日期</span>
                    </th>
                    <td>
                        <input type="text" id="DeliverDate" readonly="readonly" name="DeliverDate" runat="server"
                            class="yui-date" dtype="D" />
                    </td>
                    <th width="9%"><input id="Amount" runat="server" type="hidden" style="background: #e7eaf4;" disabled="disabled" /><input id="FactPayDate" runat="server" type="hidden" style="background: #e7eaf4; width: 92%"
                            disabled="disabled" /><input id="SaleRoad" runat="server" type="hidden" style="background: #e7eaf4; width: 92%" disabled="disabled" /><input id="OneMoney" runat="server" type="hidden" style="background: #e7eaf4; width: 92%" disabled="disabled" /><input id="PackName" runat="server" type="hidden" style="background: #e7eaf4; width: 92%" disabled="disabled" />
                        <span>总回款金额(单位：元)</span>
                    </th>
                    <td>
                        <input id="PayMoneys" runat="server" type="text" style="background: #e7eaf4;"
                            disabled="disabled" />
                        <input id="ProductPayId" runat="server" type="text" style="background: #e7eaf4; width: 92%;display: none;" />
                    </td>
                    </tr>
                <tr>
                    <th>
                        <span>客户经理</span>
                    </th>
                    <td>
                        <input type="hidden" id="CName" runat="server" />
                        <input id="txtCName" runat="server" readonly="readonly" type="text" style="width: 93px" />
                        <button id="btnCName" name="X" type="button" class="btnCheck" style="width: 30px">
                            选择</button>
                    </td>
                    <th>
                        <span>电话</span>
                    </th>
                    <td>
                        <input id="CTel" type="text" runat="server" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            onafterpaste="this.value=this.value.replace(/\D/g,'')" onblur="CheckTel1(this.value,'手机','CTel','txtZName');" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span>客户总监</span>
                    </th>
                    <td>
                        <input type="hidden" id="ZName" runat="server" />
                        <input id="txtZName" runat="server" readonly="readonly" type="text" style="width: 93px" />
                        <button id="btnZName" name="X" type="button" class="btnCheck" style="width: 30px">
                            选择</button>
                    </td>
                    <th>
                        <span>电话</span>
                    </th>
                    <td>
                        <input id="ZTel" runat="server" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            onafterpaste="this.value=this.value.replace(/\D/g,'')" onblur="CheckTel1(this.value,'手机','ZTel','IsPerformance');" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>价值业绩类型</span>
                    </th>
                    <td colspan="3">
                        <asp:DropDownList ID="IsPerformance" runat="server" onchange="getSelectValue()" AppendDataBoundItems="true" Width="138px">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="1">独立开发业绩</asp:ListItem>
                            <asp:ListItem Value="2">后续业绩</asp:ListItem>
                            <asp:ListItem Value="3">持续业绩</asp:ListItem>
                            <asp:ListItem Value="4">论坛价值业绩</asp:ListItem>
                            <%--<asp:ListItem Value="5">俱乐部价值业绩</asp:ListItem>--%>
                        </asp:DropDownList>
                        <span class="span_font">&nbsp;请选择价值业绩类型</span>
                      </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span><span>亮点分享</span>
                    </th>
                    <td colspan="3">
                        <textarea runat="server" id="TopShare" onkeydown="showSetNum('TopShare','spTop',2000)"
                            onkeyup="showSetNum('TopShare','spTop',2000)" title="最多可输入2000个汉字" name="TopShare"
                            style="height: 90px; width: 92%"></textarea>
                        <br />
                        <span style="color: red">请对业绩产生过程做下自我总结，可按以下思路： 何时发现商机？ 服务方式？ 价值服务亮点？ 成交过程概述？ 对关键点进行分享 (不少于100字！)
                        </span><span id="spTop" class="span_font"></span>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span>备注说明</span>
                    </th>
                    <td colspan="3">
                        <textarea runat="server" id="Explain" onkeydown="showSetNum('Explain','spSpans',1000)"
                            onkeyup="showSetNum('Explain','spSpans',1000)" title="最多可输入1000个汉字" name="Explain"
                            style="height: 90px; width: 92%"></textarea>
                        <br />
                        <span id="spSpans" class="span_font"></span>
                    </td>
                </tr>
                </table>
                <h3 id="valueInfo">
                价值业绩信息</h3>
                <table class="table1" id="pm">
                <%--独立开发--%>
                <tr>
                    <th width="18%">
                        <span style="color: Red;">*</span><span>独立开发类型</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlDevTpye" runat="server" onchange="getDevValue()">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <%--<asp:ListItem Value="1">N类客户4个月后完款</asp:ListItem>--%>
                            <asp:ListItem Value="2">转介绍</asp:ListItem>
                            <%--<asp:ListItem Value="3">N类客户4个月后再成交</asp:ListItem>
                            <asp:ListItem Value="4">N类客户4个月内成交或完款</asp:ListItem>--%>
                            <asp:ListItem Value="5">陌生拜访</asp:ListItem>
                            <asp:ListItem Value="6">其他</asp:ListItem>
                        </asp:DropDownList>
                        <span class="span_font">&nbsp;请选择独立开发类型</span>
                    </td>
                    <th width="18%">
                        <span style="color: Red;">*</span><span>独立开发年份</span>
                    </th><td>
                    <asp:DropDownList ID="ddlYear" runat="server">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                    </asp:DropDownList></td>
                </tr>
                <tr>
                    <th id="t1" width="18%" style="display: none">
                        <span style="color: Red;">*</span> <span>转介绍客户名称</span>
                    </th>
                    <td id="t2" width="32%" style="display: none">
                        <input id="TransCustomerName" type="text" runat="server" style="width: 92%" />
                    </td>
                    <th id="t3" width="18%" style="display: none">
                        <span style="color: Red;">*</span> <span>转介绍客户的客户类型</span>
                    </th>
                    <td id="t4" width="32%" style="display: none">
                        <asp:DropDownList ID="ddlTrans" runat="server" AppendDataBoundItems="true">
                            <asp:ListItem Value="00000000-0000-0000-0000-000000000000">--请选择--</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <%--后续业绩产生--%>
                <tr>
                    <%--   <th>
                        <span>是否经过一推</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlFirstSale" runat="server" onchange="getUnRead('ddlLastCEO','txtLastAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>--%>
                    <th width="18%">
                        <span style="color: Red;">*</span> <span>是否属于N类4个月后成交</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlAgainPay" runat="server" onchange="getUnReadAgain()">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList></td>
                    <th width="18%">
                        一推讲场时间</th>
                    <td width="32%">
                        <input type="text" style="background: #e7eaf4; width: 75px" readonly="readonly" id="txtAgainBuy"
                            disabled="disabled" maxlength="50" dtype="D" runat="server" />
                   
                        <asp:DropDownList Visible="false" ID="ddlAgainProductName" Enabled="false" AppendDataBoundItems="true"
                            runat="server">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th width="18%">
                        <span>是否一推成交</span>
                    </th>
                    <td width="32%">
                        <asp:DropDownList ID="ddlIsFirstSale" runat="server" onchange="getFirstSale()">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th width="18%">
                        <span>一推成交时间</span>
                    </th>
                    <td width="32%">
                        <input runat="server" type="text" readonly="readonly" onpropertychange="payDateChange()"
                            dtype="D" id="PayDate" name="PayDate" disabled="disabled" style="width: 75px;
                            background: #e7eaf4;" />
                        <span>一推成交名额</span>
                        <input id="FirstNum" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            onafterpaste="this.value=this.value.replace(/\D/g,'')" runat="server" style="width: 30px;" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span>一推名额是否都已经交付完毕</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlLastCEO" runat="server" onchange="getUnRead('ddlLastCEO','txtLastAddress','btnLastAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>一推名额最后一次交付时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="LastAddress" runat="server" />
                        <input type="text" runat="server" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" id="txtLastAddress" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnLastAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="txtLastAddress" maxlength="50" disabled="disabled" title="请按格式输入，例如：2012.01.01-03 深圳"
                            style="width: 92%; background: #e7eaf4;" runat="server" onchange="Blur_AddressDate('txtLastAddress')"/>--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>决策人是否上过执模</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlCEOClass" runat="server" onchange="getUnRead('ddlCEOClass','txtCEOAddress','btnCEOAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>决策人上课时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="CEOAddress" runat="server" />
                        <input type="text" runat="server" id="txtCEOAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnCEOAddress" name="KK" type="button" class="btnCheck" disabled="disabled"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="txtCEOAddress" maxlength="50" disabled="disabled" title="请按格式输入，例如：2012.01.01-03 深圳"
                            style="width: 92%; background: #e7eaf4;" runat="server" onchange="Blur_AddressDate('txtCEOAddress')" />--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>决策人是否复训</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsTrainAgain" runat="server" onchange="getUnRead('IsTrainAgain','txtTrainDateAddress','btnTrainDateAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>最后复训时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="TrainDateAddress" runat="server" />
                        <input type="text" runat="server" id="txtTrainDateAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnTrainDateAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--  <input type="text" id="TrainDateAddress" maxlength="50" disabled="disabled" title="请按格式输入，例如：2012.01.01-03 深圳"
                            style="width: 92%; background: #e7eaf4;" runat="server" name="TrainDateAddress"
                            onchange="Blur_AddressDate('TrainDateAddress')" />--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>课中是否签约</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsClassSign" runat="server" onchange="getUnRead('IsClassSign','IsPayOrder','')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>课中是否支付定金</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsPayOrder" runat="server" Enabled="false" BackColor=" #e7eaf4"
                            onchange="getUnRead('IsPayOrder','txtPay','')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                        金额(元)
                        <input type="text" id="txtPay" style="width: 40px; background: #e7eaf4;" onkeyup="this.value=this.value.replace(/[^\d\;]/g,'')"
                            onafterpaste="this.value=this.value.replace(/[^\d\;]/g,'')" disabled="disabled"
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>是否上实效管理总裁班</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsClassCEO" runat="server" onchange="getUnRead('IsClassCEO','txtCEODateAddress','btnCEODateAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>上课时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="CEODateAddress" runat="server" />
                        <input type="text" runat="server" id="txtCEODateAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnCEODateAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="CEODateAddress" style="background: #e7eaf4; width: 92%" maxlength="50"
                            title="请按格式输入，例如：2012.01.01-03 深圳" runat="server" name="CEODateAddress" disabled="disabled"
                            onchange="Blur_AddressDate('CEODateAddress')" />--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>是否老西点执行客户</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsWestPoint" runat="server" onchange="getUnRead('IsWestPoint','txtWestAddress','btnWestAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>最后名额或决策人上课时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="WestAddress" runat="server" />
                        <input type="text" runat="server" id="txtWestAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnWestAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="WestAddress" style="background: #e7eaf4; width: 92%" maxlength="50"
                            title="请按格式输入，例如：2012.01.01-03 深圳" runat="server" disabled="disabled" onchange="Blur_AddressDate('WestAddress')" />--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>是否绩效100沙龙客户 </span>
                    </th>
                    <td>
                        <asp:DropDownList ID="IsSalon" runat="server" onchange="getUnRead('IsSalon','txtLongDateAddress','btnLongDateAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span>上课时间及地点</span>
                    </th>
                    <td>
                        <input type="hidden" id="LongDateAddress" runat="server" />
                        <input type="text" runat="server" id="txtLongDateAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnLongDateAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="LongDateAddress" style="background: #e7eaf4; width: 92%" maxlength="50"
                            title="请按格式输入，例如：2012.01.01-03 深圳" runat="server" name="LongDateAddress" disabled="disabled"
                            onchange="Blur_AddressDate('LongDateAddress')" />--%>
                    </td>
                </tr>
                <tr><th> <span style="color: Red;">*</span><span>客户沉淀的时间</span></th>
                   <td colspan="3"><input id="hxcdTime"  style="width:73px;" maxlength="5" title="输入数字" onkeyup="this.value=this.value.replace(/[^\d\.]/g,'')" runat="server" onafterpaste="this.value=this.value.replace(/[^\d\.]/g,'')" type="text" />个月 <span style="color:Red">&nbsp;(从成为F类客户/上实效/上绩效100沙龙距离本次产生价值业绩完款的时间，例如客户于2012年12月1日苏州执模上课，成为F类客户，并于2013年1月23日产生1笔后续业绩完款，那么该客户沉淀的时间为1.8个月)</span></td></tr>
                <tr>
                    <th>
                        <span>课中未签约原因</span>
                    </th>
                    <td colspan="9">
                        <textarea runat="server" id="UnSignClassReason" onkeydown="showSetNum('UnSignClassReason','Span1',200)"
                            onkeyup="showSetNum('UnSignClassReason','Span1',200)" title="最多可输入200个汉字" name="UnSignClassReason"
                            style="height: 60px; overflow: hidden; width: 96%"></textarea>
                        <br />
                        <span id="Span1" class="span_font"></span>
                    </td>
                </tr>
                <%--持续业绩产生--%>
                <tr>
                    <th width="18%">
                        <span style="color: Red;">*</span> <span>原鹰计划签约是否课中签约</span>
                    </th>
                    <td width="32%">
                        <asp:DropDownList ID="EPIsClassSign" runat="server" onchange="getUnRead('EPIsClassSign','txtEPDateAddress','btnEPDateAddress')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th width="18%">
                        <span>原鹰计划签约时间及地点</span>
                    </th>
                    <td width="32%">
                        <input type="hidden" id="EPDateAddress" runat="server" />
                        <input type="text" runat="server" id="txtEPDateAddress" title="请严格输入时间地点的格式，例如：
2012-09-08 -- 2012-09-10  重庆" style="width: 77%; background: #e7eaf4;" readonly="readonly" />
                        <button id="btnEPDateAddress" name="KK" type="button" disabled="disabled" class="btnCheck"
                            style="height: 25px;">
                            选择</button>
                        <%--<input type="text" id="EPDateAddress" style="background: #e7eaf4; width: 92%" maxlength="50"
                            title="请按格式输入，例如：2012.01.01-03 深圳" runat="server" name="EPDateAddress" disabled="disabled"
                            onchange="Blur_AddressDate('EPDateAddress')" />--%>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>原鹰计划是否课中完款</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="EPClassPay" runat="server" onchange="getUnRead('EPClassPay','EPPayDate','')">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>
                        <span style="color: Red;">*</span><span>原鹰计划课后完款时间 </span>
                    </th>
                    <td>
                        <input type="text" style="background: #e7eaf4; width: 75px" readonly="readonly" name="EPPayDate"
                            id="EPPayDate" disabled="disabled" maxlength="50" dtype="D" runat="server" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span> <span>原鹰计划金额(单位：元)</span>
                    </th>
                    <td>
                        <input type="text" id="EPMoney" style="width:75px;" maxlength="50" onkeyup="this.value=this.value.replace(/[^\d\;]/g,'')"
                            onafterpaste="this.value=this.value.replace(/[^\d\;]/g,'')" title="多个可输入50个汉字长度"
                            runat="server" name="EPMoney" />
                    </td>
                    <th>
                        <span style="color: Red;">*</span> <span>是否合作过项目</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlProject" runat="server" onchange="getCOProject()">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                            <asp:ListItem Value="1">是</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                      <span>合作项目的金额(单位：元)</span>
                    </th>
                    <td>
                        <input type="text" id="ProjectMoney" style="background: #e7eaf4;width:75px;" maxlength="50" onkeyup="this.value=this.value.replace(/[^\d\;]/g,'')"
                            disabled="disabled" onafterpaste="this.value=this.value.replace(/[^\d\;]/g,'')" title="多个可输入50个汉字长度"
                            runat="server"/>
                    </td>
                    <th>
                           <span>合作项目的类型</span>
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlProjectType" Enabled="false" runat="server" AppendDataBoundItems="true">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr><th><span style="color: Red;">*</span> <span>客户沉淀的时间</span></th>
                   <td colspan="3"><input id="cxcdTime"  style="width:73px;" maxlength="5" title="输入数字" onkeyup="this.value=this.value.replace(/[^\d\.]/g,'')" runat="server" onafterpaste="this.value=this.value.replace(/[^\d\.]/g,'')" type="text" />个月 <span style="color:Red">&nbsp;(从原鹰计划完款时间距离本次产生价值业绩完款的时间多久，例如客户于2012年1月4日合作了鹰计划29万并完款于2013年1月4日再加报产生持续业绩那么该客户沉淀的时间为12个月)</span></td></tr>
            </table>
            <br />
            <table id="tbReturn" style="width: 100%;text-align:center;" border="1">
                <%--            <tr>
                <td colspan="3" style="width: 100% height: 17px" align="left" valign="top">
                    <span style="color: black">流程说明</span></td>
            </tr>--%>
                <tr>
                    <td style="height: 16px;" colspan="3">
                        <asp:GridView ID="gvworkflowMessage" CssClass="GridViewStyle" runat="server" AutoGenerateColumns="False"
                            Width="100%">
                            <Columns>
                                <asp:BoundField DataField="WorkFlowNo" HeaderText="流程编号">
                                    <ItemStyle Width="5%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TaskInstanceCaption" HeaderText="任务名称">
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="FlowCaption" HeaderText="流程名称">
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="OperatedDes" HeaderText="处理者">
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                                <asp:BoundField DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" HtmlEncode="False" DataField="taskEndTime"
                                    HeaderText="任务结束时间">
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Message" HeaderText="审批意见">
                                    <ItemStyle Width="25%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="SuccessMsg" HeaderText="状态">
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                            </Columns>
                            <FooterStyle CssClass="FooterStyle" />
                            <RowStyle CssClass="RowStyle" />
                            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                            <PagerStyle CssClass="PagerStyle" />
                            <SelectedRowStyle CssClass="SelectedRowStyle" />
                            <HeaderStyle CssClass="HeaderStyle" />
                            <EditRowStyle CssClass="EditRowStyle" />
                            <AlternatingRowStyle CssClass="AltRowStyle" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr style="display: none">
                    <td>
                        <asp:DropDownList ID="DliverState" runat="server" Width="159px">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <%-- 弹出框 --%>
    <div id="dialog1" class="yui-pe-content">
        <div class="hd">
            数据选择</div>
        <div class="bd">
            <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    <div id="dialog3" class="yui-pe-content">
        <div class="hd">
            人员选择</div>
        <div class="bd">
            <iframe id="EditUIWindow3" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    <input type="hidden" id="ID" runat="server" />
    <input type="hidden" id="WorkFlowInsId" runat="server" />
    <input type="hidden" id="WorkTaskInsId" runat="server" />
    </form>
    <form id="form2" style="display: none" action="">
    <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script type="text/javascript">
    var entity = "CrmValue", StrId = "<%=StrId %>", flag = "<%=Flag %>", strView = "<%=strView %>", action = "<% =DataAction %>", WorkflowInsId="<%=strWorkflowInsId %>",  WorkTaskInsId=$("#WorkTaskInsId").val(),
        Url = "" ,WorkFlowId="<%=strWorkFlowId %>",WorkTaskId="<%=strWorkTaskId %>",strOperStatus="<%=strOperStatus %>", strDescript="<%=strDescript %>",
        OperatorInstanceId="<%=strOperatorInstanceId %>";

          
    var getTsid=$("#WorkTaskInsId").val();
    var vid = $("#ID").val();
    var btnSave = "", btnQdnx = "", btnNxja = "", btnClose = "", condition = "", btnNews1 = "", btnDeletes1 = "";  
    <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>
    var getDevValue = function () {   
        if ($("#ddlDevTpye").val() == "2") {
            document.getElementById("t1").style.display = "";
            document.getElementById("t2").style.display = "";
            document.getElementById("t3").style.display = "";
            document.getElementById("t4").style.display = "";
        } else {
            document.getElementById("t1").style.display = "none";
            document.getElementById("t2").style.display = "none";
            document.getElementById("t3").style.display = "none";
            document.getElementById("t4").style.display = "none";
        }
    }
    var getSelectValue = function () {
       initTableTr(); 
    }
    function btnAddRow(z,a,b,c,d,e)
    {
        var rownum=$("#table1 tr").length-2;
        //第0个td
        var text0=z;
        //第一个td
        var text1=a;       
        //第二个td
        var text2=b; 
        //第三个td
        var text3=c;
       
        //第四个td
        var text4=d;
       //第五个td
        var text5=e;
        var row="<tr><td style='text-align:center'>"+text0+"</td><td style='text-align:center'>"+text1+"</td><td style='text-align:center'>"+text2+"</td><td style='text-align:center'>"+text3+"</td><td style='text-align:center'>"+text4+"</td><td style='text-align:center'>"+text5+"</td></tr>";
        $(row).insertAfter($("#table1 tr:eq("+rownum+")"));
    }
    //删除table的行
    function btnDeleteRow()
    {
	    var rownum=$("#table1 tr").length;
        var tb =document.getElementById("table1");
	    for (var i = 1; i < rownum; i++) {
            tb.deleteRow(1);
        }
    };
    //验证手机号码是否为11位
    var CheckTel1 = function (val, title, id, nexid) {
        var vLength = $("#" + id).val().length;
        $("#" + nexid).focus();
        if (vLength != 11) {
            if (confirm("您确定" + title + "长度为 " + vLength + " 位!")) {
                $("#" + nexid).focus();
            } else {
                $("#" + id).focus();
                document.getElementById(id).createTextRange().select();
            }
        }
    }
    var getUnReadLast=function(obj,selObj){
        if($("#ddlLastCEO").val()=="1"){ 
            $("#"+obj).attr('disabled', false);
            $("#"+obj).attr('style','background:white;width:92%'); 
            $("#"+selObj).attr('disabled', false);
            $("#"+selObj).attr('style','background:white;width:92%'); 
           //  $("#"+obj).attr('readonly', false);
        }else{
           $("#"+obj).attr('disabled', true);
           $("#"+obj).val("");
            $("#"+obj).attr('style','background:#e7eaf4;width:92%'); 
            $("#"+selObj).attr('disabled', true);
            $("#"+selObj).attr('style','background:#e7eaf4;width:92%');
            $("#"+selObj).val("");
        }
    }
    var getUnReadAgain=function(){         
        if($("#ddlAgainPay").val()=="1"){ 
                $("#txtAgainBuy").attr('disabled', false);
                $("#txtAgainBuy").attr('style','background:white;width:75px;');
                $("#ddlAgainProductName").attr('disabled', false);
            }else{
                $("#txtAgainBuy").attr('disabled', true);
                $("#ddlAgainProductName").attr('disabled', true);
                $("#txtAgainBuy").attr('style','background:#e7eaf4;width:75px;');
                $("#txtAgainBuy").val("");
                $("#ddlAgainProductName").val("");
            }  
    }
    var getCOProject=function(){         
        if($("#ddlProject").val()=="1"){ 
                $("#ProjectMoney").attr('disabled', false);
                $("#ProjectMoney").attr('style','background:white;width:75px;');
                $("#ddlProjectType").attr('disabled', false);
            }else{
                $("#ProjectMoney").attr('disabled', true);
                $("#ddlProjectType").attr('disabled', true);
                $("#ProjectMoney").attr('style','background:#e7eaf4;width:75px;');
                $("#ProjectMoney").val("");
                $("#ddlProjectType").val("");
            }  
    }
    var getFirstSale=function(){         
        if($("#ddlIsFirstSale").val()=="1"){ 
                $("#PayDate").attr('disabled', false);
                $("#PayDate").attr('style','background:white;width:75px;');
            }else{
                $("#PayDate").attr('disabled', true);
                $("#PayDate").attr('style','background:#e7eaf4;width:75px;');
                $("#PayDate").val("");
            }  
    }
    var getUnRead=function(selObj,obj,btnObj){  
        if (selObj=="IsClassSign") {
            if($("#"+selObj).val()=="1"){ 
                $("#"+obj).attr('disabled', false);
                $("#"+obj).attr('style','background:white;');
                //$("#"+obj).attr('readonly', false);
            }else{
                $("#"+obj).attr('disabled', true);
                $("#"+obj).attr('style','background:#e7eaf4;');
                $("#"+obj).val("");
                $("#txtPay").attr('disabled', true);
                $("#txtPay").attr('style','background:#e7eaf4;width:60px;');
                $("#txtPay").val("");

            }
        }
        else if(selObj=="IsPayOrder") {
            if($("#"+selObj).val()=="1"){ 
                $("#"+obj).attr('disabled', false);
                $("#"+obj).attr('style','background:white;width:40px;');
                //$("#"+obj).attr('readonly', false);
            }else{
                $("#"+obj).attr('disabled', true);
                $("#"+obj).attr('style','background:#e7eaf4;width:40px;');
                $("#"+obj).val("");
            }
        }else if(selObj=="EPClassPay") { 
            if($("#"+selObj).val()=="0"){ 
                $("#"+obj).attr('disabled', false);
                $("#"+obj).attr('style','background:white;width:75px;');
                //$("#"+obj).attr('readonly', false);
            }else{
                $("#"+obj).attr('disabled', true);
                //$("#"+obj).attr('readonly', false);
                $("#"+obj).attr('style','background:#e7eaf4;width:75px;');
                $("#"+obj).val("");

            }
        }else{    
           if($("#"+selObj).val()=="1"){ 
                $("#"+obj).attr('disabled', false);
                $("#"+btnObj).attr('disabled', false);
                $("#"+obj).attr('style','background:white;width:77%');
                // $("#"+obj).attr('readonly', false);
            }else{
                $("#"+obj).attr('disabled', true);
                $("#"+btnObj).attr('disabled', true);
                $("#"+obj).attr('style','background:#e7eaf4;width:77%');
                $("#"+obj).val("");
               
            }
        }        
    }
    var initTableTr=function(){
        if ($("#ddlDevTpye").val() == "2") {
            document.getElementById("t1").style.display = "";
            document.getElementById("t2").style.display = "";
            document.getElementById("t3").style.display = "";
            document.getElementById("t4").style.display = "";
        } else {
            document.getElementById("t1").style.display = "none";
            document.getElementById("t2").style.display = "none";
            document.getElementById("t3").style.display = "none";
            document.getElementById("t4").style.display = "none";
        }
        var trs = $("#pm tr").not("#table1 tr");
        if ($("#IsPerformance").val() == "1") {
            for (var i = 0; i < trs.length; i++) {
                if (i >= 0 && i < 2) {
                    trs[i].style.display = "block";
                } else {
                    trs[i].style.display = "none";
                }
            }
        }
        else if ($("#IsPerformance").val() == "2") {
            for (var i = 0; i < trs.length; i++) {
                if (i >1 && i < 13) {
                    trs[i].style.display = "block";
                } else {
                    trs[i].style.display = "none";
                }
            }
        }
        else if ($("#IsPerformance").val() == "3") {
            for (var i = 0; i < trs.length; i++) {
                if ((i>=13)) {
                    trs[i].style.display = "block";
                } else {
                    trs[i].style.display = "none";
                }
            }
        } else {
            for (var i = 0; i < trs.length; i++) {
//                if (i >= 0 && i < 1) {
//                    trs[i].style.display = "block";
//                } else {
                    trs[i].style.display = "none";
//                }
            }
            
        }
    }
    /*客户选择对应的方法和ID*/
    var _fn, _id;
    function ShowDialog(fn, id, src) {
        _fn = fn;
        _id = id;
        document.getElementById("EditUIWindow1").src = src;
        YAHOO.example.container.dialog1.show();
    }
    /* 对应的方法和ID*/
    var _fn, _id;
    function ShowDialog1(fn, id,src) {if ($("#CustomerName").val()=="") {
                  alert("请您先选择客户"); return;
                }
        _fn = fn;
        _id = id;         
        document.getElementById("EditUIWindow1").src = src+"&cid=CustomerId='"+$("#CustomerID").val()+"'";
        YAHOO.example.container.dialog1.show();
    }
    function ShowDialog3(fn, id) {
    _fn = fn;
    _id = id;
    YAHOO.example.container.dialog3.show();
}
    //加载订单期数信息
var LoadCourseLayout = function (objValue) {
    var vCId = "ID='" + objValue + "'";
    YAHOO.util.Connect.asyncRequest('GET', "../../Extend/AjaxData/JSONList.aspx?r=" + Math.random() + "&type=1&entity=CrmProductLayout&customCondition=" + vCId + "", //条件 
        {success: function (res) {
            try {
                var str = res.responseText;
                var arr = [];
                var obj = eval(str);
                //$("#OrderDate").val(obj[0].BeginDate + "-" + obj[0].EndDate);
                //$("#OrderAddress").val(obj[0].Place);
            }
            catch (e) {
            }
            finally {
            }
        }, failure: function () { }
    });
}
//    function Blur_AddressDate(obj)
//    {
//        var myDate = new Date();
//        var yy = myDate.getYear();
//        if (yy < 1900) yy = yy + 1900;
//        var MM = myDate.getMonth() + 1;
//        if (MM < 10) MM = '0' + MM;
//        var dd = myDate.getDate();
//        if (dd < 10) dd = '0' + dd;
//        var LocalDate = yy + "." + MM + ".01-03 深圳";   
//        //var TextAddressDate=document.getElementById(obj).value;
//        var reg = /^(\d{1,4})(.|\/)(\d{1,2})(.|\/)(\d{1,2})(-|\/)(\d{1,2}) .*$/;
//        var r = $("#"+obj).val().match(reg);
//         if (r == null) {
//            alert("请您输入正确的时间及地点格式，如：2012.01.01-03 深圳");
//            $("#"+obj).val(LocalDate);
//         }
////        var myregAddressDate =  /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;
////            //开始验证时间及地点格式。
////        var TextAddressDate=document.getElementById(obj).value;
////        if(myregAddressDate.test(TextAddressDate)==false)
////        {
////            //错误的时间及地点；
////            alert("请您输入正确的时间及地点格式，如：2012.01.01-03 深圳");
////        }     
//    }
    //选择客户编码显示客户信息
    var LoadCustomerData = function () {
        var vCId = "ID='" + $("#CustomerID").val() + "'";
        YAHOO.util.Connect.asyncRequest('GET', "../../Extend/AjaxData/JSONList.aspx?r=" + Math.random() + "&type=1&entity=V_CrmCustomerInfoSale&customCondition=" + vCId + "", //条件 
        {success: function (res) {
            try {
                var str = res.responseText;
                var arr = [];
                var obj = eval(str);
                $("#CustomerName").val(obj[0].CustomerName);
                $("#cType").val(obj[0].TypeName);
                $("#CValue").val(obj[0].ProductName);
            }
            catch (e) {
            }
            finally {
            }
        }, failure: function () { }
    });
}
var csNum;
var change = function (obj) {
    csNum = obj
}
 //选择产品编码显示客户信息
    var LoadProductData = function () {
        var vMemeber=$("#Memember").val();
        var strs = new Array(); //定义一数组
        strs=vMemeber.split(","); //字符分割 
        var tempCon;
        if(strs.length>0){
            tempCon="and";
        }
        for (i=0;i<strs.length ;i++ )    
        {
            tempCon+= " (ID='"+strs[i]+"') or ";
                     
        }
        tempCon=tempCon.substr(0,tempCon.length-3);
        var vCId = "CustomerID='" + $("#CustomerID").val() + "' "+tempCon;
        YAHOO.util.Connect.asyncRequest('GET', "../../Extend/AjaxData/JSONList.aspx?r=" + Math.random() + "&type=1&entity=V_CrmValuePay&customCondition=" + vCId + "", //条件 
        {success: function (res) {
            try {
                if ($("#CustomerName").val()!="") {
                    var str = res.responseText;
                    var arr = [];
                    var obj = eval(str);
                    var totalMoney=0;
                    btnDeleteRow();
                    if(vMemeber!=""){
                    var srTemp="",amTemp="",fpdTemp="",idTemp="",mTemp="";
                    
                    var tempNus=0;     
                    for (i=0;i<strs.length ;i++ )    
                    {   
                        for (var j = 0; j < obj.length; j++) {
                            if(strs[i]==obj[j].ID)    {btnAddRow($("#PackName").val(),obj[j].Caption,obj[j].Amount,obj[j].PhraseText,obj[j].PayMoney,obj[j].FactPayDate);
                                totalMoney=parseFloat(obj[j].PayMoney)+parseFloat(totalMoney);    //分割后的字符输出
                                srTemp= srTemp+"，"+obj[j].PhraseText;
                                amTemp= amTemp+"，"+obj[j].Amount;
                                fpdTemp=fpdTemp+"，"+obj[j].FactPayDate;
                                idTemp=idTemp+","+obj[j].ID;
                                mTemp=mTemp+ "，" +obj[j].PayMoney;
                            }                       
                        }  
                    }
                    if(srTemp.length>0){  
                        $("#SaleRoad").val(srTemp.substr(1,srTemp.length));
                        $("#OneMoney").val(mTemp.substr(1,mTemp.length));
                        $("#Amount").val(amTemp.substr(1,amTemp.length));   
                        $("#FactPayDate").val(fpdTemp.substr(1,fpdTemp.length));
                        $("#ProductPayId").val(idTemp.substr(1,idTemp.length));
                        loadPay();
                    }       
                        $("#PayMoneys").val(totalMoney); 
                        $("#CName").val(obj[tempNus].ICName);
                        $("#txtCName").val(obj[tempNus].Name);
                        $("#ZName").val(obj[tempNus].ICZName);
                        $("#txtZName").val(obj[tempNus].UName);
                        $("#CTel").val(obj[tempNus].MMobile);
                        $("#ZTel").val(obj[tempNus].Mobile); 
                    }else{
                    $("#OneMoney").val("");
                        $("#SaleRoad").val("");
                        $("#Amount").val("");   
                        $("#FactPayDate").val("");             
                        $("#PayMoneys").val(""); 
                        $("#CName").val("");
                        $("#ZName").val("");
                        $("#CTel").val("");
                        $("#ZTel").val("");     
                    }   
                }else{alert("您需选中至少一条记录");return;}
            }
            catch (e) {
            }
            finally {
            }
        }, failure: function () { }
    });
}
var loadPay = function () {
    var vid = $("#ProductPayId").val();
    YAHOO.util.Connect.asyncRequest('POST', "../../Extend/AjaxData/CustomOperating.aspx?entity=CrmValue_CrmProductPay&action=insert&cid=" + vid, //条件 
            {success: function (res) {
                try {
                    var str = res.responseText;
                    if (str == "1"&&strDescript != "nxja"&&strView != "unDone") {
                        alert("您选择的产品已经提交过价值业绩了");
                        location.reload(false);
                    }
                }
                catch (e) {
                }
                finally {
                }
            }, failure: function () { }
        });
}
      var Dom = YAHOO.util.Dom,Event = YAHOO.util.Event;
        Event.onDOMReady(function () {
            var layout = new YAHOO.widget.Layout({
                units: [
                { position: 'bottom', height: 45, body: 'toolbar', gutter: '1 1 1 1', scroll: null, zIndex: 2 },
                { position: 'center', body: 'fieldForm', gutter: '0 1 1 1', scroll: true }
                ]
            });
            layout.render();
        });
 
    YAHOO.namespace("example.container");
    YAHOO.util.Event.onDOMReady(function () {
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow1");
            if (editwindow) {
                editwindow.contentWindow.ChooseInfo();
                if (csNum == "1") {
                LoadCustomerData();}else if (csNum == "2") {
                LoadProductData();}
                if (_id == "btnLastAddress") {
               // LoadCourseLayout($("#LastAddress").val());
            }
            }
            YAHOO.example.container.dialog1.hide();
        };
        var handleCancel = function () {
            this.cancel();
        };

        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleSubmit3 = function () {
        var editwindow = document.getElementById("EditUIWindow3");
        if (editwindow) {
            editwindow.contentWindow.ChooseInfo();
        }
        YAHOO.example.container.dialog3.hide();
    };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1", {
            width: "550px",
            height: "350px",
            fixedcenter: true,
            visible: false,
            draggable: true,
            close: true,
            autofillheight: "body",
            constraintoviewport: true,
            buttons: [{ text: "确定", handler: handleSubmit, isDefault: true },
			    { text: "取消", handler: handleCancel}]
        });
        YAHOO.example.container.dialog1.callback = { success: handleSuccess, failure: handleFailure };
        YAHOO.example.container.dialog1.render();
        YAHOO.example.container.dialog3 = new YAHOO.widget.Dialog("dialog3", {
            width: "550px",
            height: "350px",
            fixedcenter: true,
            visible: false,
            draggable: true,
            close: true,
            autofillheight: "body",
            constraintoviewport: true,
            buttons: [{ text: "确定", handler: handleSubmit3, isDefault: true },
			    { text: "取消", handler: handleCancel}]
        });
        YAHOO.example.container.dialog3.callback = { success: handleSuccess, failure: handleFailure };
        YAHOO.example.container.dialog3.render();
        //拖动大小
        var resize = new YAHOO.util.Resize("dialog1", {
            handles: ["br"],
            autoRatio: false,
            minWidth: 650,
            minHeight: 450,
            status: false
        });
        resize.on("startResize", function (args) {
            if (this.cfg.getProperty("constraintoviewport")) {
                var D = YAHOO.util.Dom;
                var clientRegion = D.getClientRegion();
                var elRegion = D.getRegion(this.element);
                resize.set("maxWidth", clientRegion.right - elRegion.left - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
                resize.set("maxHeight", clientRegion.bottom - elRegion.top - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
            } else {
                resize.set("maxWidth", null);
                resize.set("maxHeight", null);
            }
        }, YAHOO.example.container.dialog1, true);
        resize.on("resize", function (args) {
            var panelHeight = args.height;
            this.cfg.setProperty("height", panelHeight + "px");
        }, YAHOO.example.container.dialog1, true);
    });
     YAHOO.example.init = function () {
    function onButtonClick(p_oEvent) {
        switch (this.get("id")) {
            case "btnSave":
                Save();
                break;
            case "btnClose":
                Close();
                break;
            case "btnQdnx":
                SaveQdnx();
                break;
            case "btnNxja":
                SaveNxja();
                break; 
            default:
                break;
        }
    }
    YAHOO.util.Event.onContentReady("toolbar", function () {
        btnSave = new YAHOO.widget.Button("btnSave");
        btnSave.on("click", onButtonClick);
        btnQdnx = new YAHOO.widget.Button("btnQdnx");
        btnQdnx.on("click", onButtonClick);
        btnNxja = new YAHOO.widget.Button("btnNxja");
        btnNxja.on("click", onButtonClick);
        btnClose = new YAHOO.widget.Button("btnClose");
        btnClose.on("click", onButtonClick);
        if (strView == "check") {
            setControlDisabled();
            btnQdnx._button.style.display = "none";
            $("#btnQdnx").attr('disabled', "true");
            btnNxja._button.style.display = "none";
            $("#btnNxja").attr('disabled', "true");
            btnClose._button.style.display = "none";
            $("#btnClose").attr('disabled', "true");
            btnSave._button.style.display = "none";
            $("#btnSave").attr('disabled', "true");
        }else if (strView == "checks") {
            setControlDisabled();
            btnQdnx._button.style.display = "none";
            $("#btnQdnx").attr('disabled', "true");
            btnNxja._button.style.display = "none";
            $("#btnNxja").attr('disabled', "true");
            btnClose._button.style.display = "none";
            $("#btnClose").attr('disabled', "true");
            btnSave._button.style.display = "none";
            $("#btnSave").attr('disabled', "true");
        } else if (strView == "0") {
            //setControlDisabled();
            btnQdnx._button.style.display = "none";
            $("#btnQdnx").attr('disabled', "true");
//            btnNxja._button.style.display = "none";
//            $("#btnNxja").attr('disabled', "true");
            btnClose._button.style.display = "none";
            $("#btnClose").attr('disabled', "true");
            btnSave._button.style.display = "none";
            $("#btnSave").attr('disabled', "true");
        }
        else {
            if(strDescript == "nxqd") {
                setControlDisabled();
                btnSave._button.style.display = "none";
                $("#btnSave").attr('disabled', "true");
                btnNxja._button.style.display = "none";
                $("#btnNxja").attr('disabled', "true");
            }else if (strDescript == "nxja") {
                //setControlDisabled();
                btnQdnx._button.style.display = "none";
                $("#btnQdnx").attr('disabled', "true");
                btnSave._button.style.display = "none";
                $("#btnSave").attr('disabled', "true");
            }else { //新增时设置按钮隐藏
                btnQdnx._button.style.display = "none";
                $("#btnQdnx").attr('disabled', "true");
                btnNxja._button.style.display = "none";
                $("#btnNxja").attr('disabled', "true");
                btnClose._button.style.display = "none";
                $("#btnClose").attr('disabled', "true");
            }
        }
    });
} ();
 //刷新父窗体数据
    function RefreshDataParent() {
        if (parent.NeedRefreshPage != null) {
            if (typeof (parent.NeedRefreshPage.LoadData) == "function") {
                parent.NeedRefreshPage.RefreshData();
            }
        }
    }
 var responseSuccess = function (res) {
        try {                    
            var str = res.responseText;
            if (str == "1") { 
                RefreshDataParent();
                window.location.href = "../../Crm/BasePages/tooltip.aspx?worktaskInstanceId=" + getTsid;
            }
            else {
                alert(str);
            }
        } catch (e) {
        }
        finally {
        }
    }

    var responseFailure = function (error) {
        alert("数据错误：" + error.statusText);
    }

    var callback = {
        success: responseSuccess,
        failure: responseFailure
    };
//保存
var Save = function (obj) {      
    setValue();
    if ($("#CustomerName").val() == "") {
        alert("请选择客户");
        $("#CustomerName").focus();
        return;
    }
    if ($("#txtMemember").val()=="") {
        alert("请选择产品"); 
        $("#txtMemember").focus();  
        return;
    }
    if ($("#txtCName").val()=="") {
        alert("请选择客户经理"); 
        $("#txtCName").focus();  
        return;
    }
    if($("#TopShare").val()==""){
        alert("请填写亮点分享"); 
        $("#TopShare").focus();  
        return;
    }
    if($("#TopShare").val().length<=100){
        alert("请填写不少于100字的亮点分享"); 
        $("#TopShare").focus();  
        return;
    }
    if ($("#IsPerformance").val() == "") {
        alert("请选择价值业绩类型");
        $("#IsPerformance").focus();
        return;
    }
    if ($("#IsPerformance").val() == "1") {
        if ($("#ddlDevTpye").val() == "") {
            alert("请选择独立开发类型");
            $("#ddlDevTpye").focus();
            return;        
        }
        if ($("#ddlYear").val()=="") {
            alert("请选择年份");
            $("#ddlYear").focus();
            return;
        }
        if ($("#ddlDevTpye").val() == "2") {
            if($("#TransCustomerName").val()=="") {
                alert("请填写转介绍客户名称");
                $("#TransCustomerName").focus();
                return;                         
            }
            if($("#ddlTrans").val()=="00000000-0000-0000-0000-000000000000") {
                alert("请选择转介绍客户类型");
                $("#ddlTrans").focus();
                return;                         
            }
        }
    }
    if ($("#IsPerformance").val() == "2") {
        if($("#ddlAgainPay").val()=="") { 
            alert("请填写是否属于N类4个月后成交");
            $("#ddlAgainPay").focus();
            return;
        }
        if($("#ddlAgainPay").val()=="1") {
            if($("#txtAgainBuy").val()=="") {
                alert("请填写讲场时间");
                $("#txtAgainBuy").focus();
                return;
            }
//            if($("#ddlAgainProductName").val()=="") {
//                alert("请填写购买产品名称");
//                $("#ddlAgainProductName").focus();
//                return;
//            }
        }
        if($("#ddlIsFirstSale").val()=="") {
            alert("请填写是否一推");
            $("#ddlIsFirstSale").focus();
            return;
        }
        if($("#ddlIsFirstSale").val()=="1") {
            if($("#PayDate").val()==""){
                alert("请填写一推时间");
                $("#PayDate").focus();
                return;
            }
            if($("#PayDate").val()!=""){
                if($("#FirstNum").val()=="") {
                    alert("请填写一推名额");
                    $("#FirstNum").focus();
                    return;
                }
                if($("#ddlLastCEO").val()==""){
                    alert("请填写一推名额是否都已经交付完毕");
                    $("#ddlLastCEO").focus();
                    return;
                }
            }
        } 
        if($("#ddlLastCEO").val()=="1"){ 
            if($("#txtLastAddress").val()=="") {
                alert("请填写一推名额最后一次交付时间及地点");
                $("#txtLastAddress").focus();
                return;
            }
        }
        if($("#ddlCEOClass").val()==""){
            alert("请填写决策人是否上过执模");
            $("#ddlCEOClass").focus();
            return; 
        }
       if($("#ddlCEOClass").val()=="1"){ 
            if($("#txtCEOAddress").val()=="") {
                alert("请填写决策人上课时间及地点");
                $("#txtCEOAddress").focus();
                return;
            }
       }
       if($("#IsTrainAgain").val()==""){ 
            alert("请填写决策人是否复训");
            $("#IsTrainAgain").focus();
            return;
       }
       if($("#IsTrainAgain").val()=="1"){ 
            if($("#txtTrainDateAddress").val()=="") {
                alert("请填写最后复训时间及地点");
                $("#txtTrainDateAddress").focus();
                return;
            }
       }
       if($("#IsClassSign").val()==""){
            alert("请填写课中是否签约");
            $("#IsClassSign").focus();
            return;
       }
       if($("#IsClassSign").val()=="1"){ 
            if($("#IsPayOrder").val()=="") {
                alert("请填写课中是否支付定金");
                $("#IsPayOrder").focus();
                return;
            } 
       }
       if($("#IsPayOrder").val()=="1"){
            if($("#txtPay").val()=="") {
                alert("请填写金额");
                $("#txtPay").focus();
                return;
            } 
       }
       if($("#IsClassCEO").val()==""){
            alert("请填写是否上实效管理总裁班");
            $("#IsClassCEO").focus();
            return;
       }
       if($("#IsClassCEO").val()=="1"){ 
            if($("#txtCEODateAddress").val()=="") {
                alert("请填写上课时间及地点");
                $("#txtCEODateAddress").focus();
                return;
            }
       }
       if($("#IsWestPoint").val()==""){
            alert("请填写是否老西点执行客户");
            $("#IsWestPoint").focus();
            return;
       }
       if($("#IsWestPoint").val()=="1"){ 
            if($("#txtWestAddress").val()=="") {
                alert("请填写最后名额或决策人上课时间及地点");
                $("#txtWestAddress").focus();
                return;
            }
       }
       if($("#IsSalon").val()==""){
            alert("请填写是否绩效100沙龙客户");
            $("#IsSalon").focus();
            return;
       }
       if($("#IsSalon").val()=="1"){ 
            if($("#txtLongDateAddress").val()=="") {
                alert("请填写上课时间及地点");
                $("#txtLongDateAddress").focus();
                return;
            }
       } 
       if($("#hxcdTime").val()=="") {
            alert("请填写客户沉淀的时间");
            $("#hxcdTime").focus();
            return;
       }
       if($("#IsClassSign").val()=="0"){ 
              if($("#UnSignClassReason").val()=="") {
               alert("请填写课中未签约原因");
               $("#UnSignClassReason").focus();
               return;
           }
       }
    }
    if ($("#IsPerformance").val() == "3") {
        if($("#EPIsClassSign").val()=="") {
            alert("请填写原鹰计划签约是否课中签约");
            $("#EPIsClassSign").focus();
            return;
        }
        if($("#EPIsClassSign").val()=="1"){ 
            if($("#txtEPDateAddress").val()=="") {
                alert("请填写原鹰计划签约是否课中签约");
                $("#txtEPDateAddress").focus();
                return;
            }
        }
        if($("#EPClassPay").val()=="") {
            alert("请填写原鹰计划是否课中完款");
            $("#EPClassPay").focus();
            return;
        }
        if($("#EPClassPay").val()=="0"){
            if($("#EPPayDate").val()=="") {
                alert("请填写原鹰计划签约时间及地点");
                $("#EPPayDate").focus();
                return;
            } 
        }
        if($("#EPMoney").val()==""){
           alert("请填写原鹰计划金额");
                $("#EPMoney").focus();
                return;
        }
        if($("#ddlProject").val()==""){
           alert("请填写是否合作过项目");
                $("#ddlProject").focus();
                return;
        }
        if($("#ddlProject").val()=="1"){
            if($("#ProjectMoney").val()=="") {
                alert("请填写合作项目的金额");
                $("#ProjectMoney").focus();
                return;
            }
            if($("#ddlProjectType").val()=="") {
                alert("请填写合作项目的类型");
                $("#ddlProjectType").focus();
                return;
            } 
        }
        if($("#cxcdTime").val()=="") {
            alert("请填写客户沉淀的时间");
            $("#cxcdTime").focus();
            return;
        }
    }
    var json = $.toJSON(instance[0]).replace(/'/g, "[B]");
    $("#jsonDataContent").val(json);
    setTimeout(function () {
        var btn = document.getElementById("btnSave");
        btn.disabled = true;
        trySave();
        setTimeout(function () { btn.disabled = false }, 10000);
    }, 10);

}
function trySave() {
    var url = "../../Extend/AjaxData/CustomOperating.aspx?action=insert&payId="+$("#ProductPayId").val()+"&cName=" + encodeURI($("#CustomerName").val()) + "&view=" + strView + "&flag=1&entity=" + entity + "";
    var formObject = document.getElementById('form2');
    YAHOO.util.Connect.setForm(formObject);
    var cObj = YAHOO.util.Connect.asyncRequest('POST', url, callback);
}
var setValue = function () {     
    instance[0].ID = $("#ID").val();
    instance[0].CustomerID = $("#CustomerID").val();
    instance[0].TaskShare = $("#TopShare").val();  //亮点分享
    instance[0].TaskExplain = $("#Explain").val(); //备注说明
    instance[0].WorkFlowId = WorkFlowId;
    instance[0].WorkTaskId = WorkTaskId;   
    instance[0].WorkFlowInsId = $("#WorkFlowInsId").val();
    instance[0].WorkTaskInsId = $("#WorkTaskInsId").val();
    instance[0].APDate = $("#DeliverDate").val();
    instance[0].DevCustomerType = $("#ddlTrans").val();   //转介绍客户类型 V，F,N类
    instance[0].DevType = $("#ddlDevTpye").val();    //独立开发类型
    instance[0].ValueType = $("#IsPerformance").val(); //价值业绩类型
    instance[0].DevCustomerName = $("#TransCustomerName").val();  //独立开发转介绍客户名称
    instance[0].TrainDateAddress = $("#txtTrainDateAddress").val(); 
    instance[0].IsTrainAgain = $("#IsTrainAgain").val(); 
    instance[0].CEODateAddress = $("#txtCEODateAddress").val(); 
    instance[0].IsClassCEO = $("#IsClassCEO").val();
    instance[0].IsWestPoint = $("#IsWestPoint").val();  
    instance[0].IsClassSign = $("#IsClassSign").val(); 
    instance[0].IsPayOrder = $("#IsPayOrder").val(); 
    instance[0].IsSalon = $("#IsSalon").val(); 
    instance[0].UnSignClassReason = $("#UnSignClassReason").val(); 
    instance[0].EPIsClassSign = $("#EPIsClassSign").val(); 
    instance[0].EPDateAddress = $("#txtEPDateAddress").val(); 
    instance[0].EPClassPay = $("#EPClassPay").val(); 
    instance[0].EPPayDate = $("#EPPayDate").val(); 
    instance[0].EPMoney = $("#EPMoney").val();
    instance[0].ProductList = $("#txtMemember").val();
    instance[0].PayMoneyTotal = $("#PayMoneys").val();
    instance[0].Amount = $("#Amount").val();
    instance[0].SaleRoad = $("#SaleRoad").val();
    instance[0].OneMoney=$("#OneMoney").val(); 
    instance[0].LongDateAddress = $("#txtLongDateAddress").val();
    instance[0].FirstDate = $("#PayDate").val();
    instance[0].FirstNum = $("#FirstNum").val();
    instance[0].LastCEO = $("#ddlLastCEO").val();
    instance[0].CEOAddress = $("#txtCEOAddress").val();
    instance[0].LastAddress = $("#txtLastAddress").val(); 
    instance[0].FactTempDate = $("#FactPayDate").val();
    instance[0].OrderMoney = $("#txtPay").val();
    instance[0].EXP1  = $("#ddlCEOClass").val(); 
    instance[0].EXP2  = $("#ddlAgainPay").val();
    instance[0].EXP3  = $("#txtWestAddress").val();
    instance[0].AgainBuyDate  = $("#txtAgainBuy").val();
    instance[0].AgainBuyProduct  = $("#ddlAgainProductName").val();
    instance[0].CName  = $("#CName").val();
    instance[0].CZName  = $("#ZName").val();
    instance[0].CTel  = $("#CTel").val();
    instance[0].CZTel  = $("#ZTel").val();
    instance[0].DliverState=$("#DliverState").val(); 
    instance[0].IsFirstSale=$("#ddlIsFirstSale").val();
    instance[0].IsCOProject=$("#ddlProject").val();
    instance[0].ProjectType=$("#ddlProjectType").val();
    instance[0].ProjectMoney=$("#ProjectMoney").val();
    if($("#IsPerformance").val()=="2"){
        instance[0].EXP4  = $("#hxcdTime").val();
    }
    else if($("#IsPerformance").val()=="3"){
        instance[0].EXP4  = $("#cxcdTime").val();
    }
    instance[0].PackName=$("#PackName").val();
    instance[0].DevYear=$("#ddlYear").val();
}
   var SaveQdnx=function(){
        if ($("#backReason").val()!=undefined&&$("#backReason").val() != "") {
            alert("正常提交时退回原因不能填写");
            $("#backReason").val("");
            return;
        }
        var SaveUrl ="../../Extend/AjaxData/CustomOperating.aspx?action=check&ID="+ $("#ID").val()+"&payId="+$("#ProductPayId").val()+"&DliverState="+$("#DliverState").val()+"&entity=CrmValueAgreeS&OperatorInstanceId=" + OperatorInstanceId + "&WorkTaskInsId=" + WorkTaskInsId ;
        YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
            success: function (res) {
                try {        
                    var str = res.responseText;
                    if (str == "1") {
                        window.location.href = "../../Crm/BasePages/tooltip.aspx?worktaskInstanceId=" + WorkTaskInsId;
                    } 
                     else {
                        alert(str + "\n" + "操作异常!");
                        return;
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
   }
   var SaveNxja=function(){   
        if ($("#backReason").val()!=undefined&&$("#backReason").val() != "") {
            alert("正常提交时退回原因不能填写");
            $("#backReason").val("");
            return;
        }
        setValue();
        var json = $.toJSON(instance[0]).replace(/'/g, "[B]");
        $("#jsonDataContent").val(json);
        var SaveUrl ="../../Extend/AjaxData/CustomOperating.aspx?action=check&entity=CrmValueAgreeT&payId="+$("#ProductPayId").val()+"&view="+strView+"&flag=1&OperatorInstanceId=" + OperatorInstanceId + "&WorkTaskInsId=" + WorkTaskInsId + "";
        var formObject = document.getElementById('form2');
        YAHOO.util.Connect.setForm(formObject);
        YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
            success: function (res) {
                try {
                    var str = res.responseText;
                    if (str == "1") {
                        if(strView=="0"){
                            alert("修改成功");
                            window.$("#tabs").tabs('close', '修改价值业绩申请单');
                        }else{
                        window.location.href = "../../Crm/BasePages/tooltip.aspx?worktaskInstanceId=" + WorkTaskInsId;
                        }                        
                     }
                     else {
                        alert(str + "\n" + "操作异常!");
                        return;
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
   }
    //禁用控件
    var setControlDisabled =function(){  
        var obj = document.getElementById("fieldForm"); //得到DIV对象
        var s = obj.getElementsByTagName("select");
        var e = obj.getElementsByTagName("input");
        var te = obj.getElementsByTagName("textarea");
        $("#btnCustomerID").hide();
        $("#btnMemember").attr("disabled",true);
        for (var j = 0; j < s.length; j++) {
            s[j].disabled = true;
        }
        for (var i = 0; i < e.length; i++) {
            e[i].disabled = true;
        }
        for (var i = 0; i < te.length; i++) {        
            te[i].disabled = true;   
        }
    } 
    //退回上一节点
    var Close = function () {
        if ($("#backReason").val() == "") {
            alert("请填写退回原因");
            $("#backReason").focus();
            return;
        }
        var vMessage = $("#backReason").val();
        if (confirm("您确定退回?")) {
            var SaveUrl = "../../Extend/AjaxData/CustomOperating.aspx?r=" + Math.random() + "&action=check&entity=CrmValueUnAgree&msg=" + encodeURI(vMessage) + "" +
                "&OperatorInstanceId=" + OperatorInstanceId + "&WorkflowId=" + WorkFlowId + "&WorktaskId=" + WorkTaskId + "&WorkflowInsId=" + WorkflowInsId + "&WorktaskInsId=" + WorkTaskInsId + "";
            YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
                success: function (res) {
                    try {
                        var str = res.responseText;
                        if (str == "1") {
                            window.location.href = "../../Crm/BasePages/tooltip.aspx?worktaskInstanceId=" + getTsid;
                        } else {
                            alert("数据保存失败!");
                            return;
                        }
                    }
                    catch (e) {
                    }
                    finally {
                    }
                },
                failure: function (error) {
                    alert("数据错误：" + error.statusText);
                }
            }, null);
        }
     
    }
    var payDateChange=function(){  
       if($("#PayDate").val()!=""){
           $("#FirstNum").attr('disabled', false);
           $("#ddlLastCEO").attr('disabled', false);
       } else{

           $("#FirstNum").attr('disabled', true);
           $("#FirstNum").val("");
           $("#ddlLastCEO").attr('disabled', true)
           $("#ddlLastCEO").val("");
       }
    }
    var initCheckSel=function(){
      if($("#PayDate").val()==""){
        $("#btnLastAddress").attr('disabled', true);
        $("#FirstNum").attr('disabled', true);
        $("#ddlLastCEO").attr('disabled', true);} 
        if($("#ddlAgainPay").val()=="1") {
            $("#txtAgainBuy").attr('disabled', false);
            $("#txtAgainBuy").attr('style','background:white;width:75px;');
            $("#ddlAgainProductName").attr('disabled', false);
        }
        if($("#ddlIsFirstSale").val()=="1") {
            $("#PayDate").attr('disabled', false);
            $("#PayDate").attr('style','background:white;width:75px;');
        }
        if($("#ddlLastCEO").val()=="1"){ 
                $("#txtLastAddress").attr('disabled', false);
                $("#btnLastAddress").attr('disabled', false);
                $("#txtLastAddress").attr('style','background:white;width:77%');
                $("#txtLastAddress").attr('readonly', false);
        }
       if($("#ddlCEOClass").val()=="1"){ 
                $("#txtCEOAddress").attr('disabled', false);
                $("#btnCEOAddress").attr('disabled', false);
                $("#txtCEOAddress").attr('style','background:white;width:77%');
                $("#txtCEOAddress").attr('readonly', false);
       }
       if($("#IsTrainAgain").val()=="1"){ 
                $("#txtTrainDateAddress").attr('disabled', false);
                $("#btnTrainDateAddress").attr('disabled', false);
                $("#txtTrainDateAddress").attr('style','background:white;width:77%');
                $("#txtTrainDateAddress").attr('readonly', false);
       }
       if($("#IsClassSign").val()=="1"){ 
                $("#IsPayOrder").attr('disabled', false);
                $("#IsPayOrder").attr('style','background:white;');
                $("#IsPayOrder").attr('readonly', false);
       }
       if($("#IsPayOrder").val()=="1"){ 
                $("#txtPay").attr('disabled', false);
                $("#txtPay").attr('style','background:white;width:40px;');
                $("#txtPay").attr('readonly', false);
       }
       if($("#IsClassCEO").val()=="1"){ 
            $("#txtCEODateAddress").attr('disabled', false);
            $("#btnCEODateAddress").attr('disabled', false);
            $("#txtCEODateAddress").attr('style','background:white;width:77%');
            $("#txtCEODateAddress").attr('readonly', false);
       }
       if($("#IsWestPoint").val()=="1"){ 
            $("#txtWestAddress").attr('disabled', false);
            $("#btnWestAddress").attr('disabled', false);
            $("#txtWestAddress").attr('style','background:white;width:77%');
            $("#txtWestAddress").attr('readonly', false);
       }
       if($("#IsSalon").val()=="1"){ 
            $("#txtLongDateAddress").attr('disabled', false);
            $("#btnLongDateAddress").attr('disabled', false);
            $("#txtLongDateAddress").attr('style','background:white;width:77%');
            $("#txtLongDateAddress").attr('readonly', false);
       }
       if($("#EPClassPay").val()=="0"){ 
                $("#EPPayDate").attr('disabled', false);
                $("#EPPayDate").attr('style','background:white;width:75px;');
                $("#EPPayDate").attr('readonly', false);
        }
        if($("#EPIsClassSign").val()=="1"){ 
            $("#txtEPDateAddress").attr('disabled', false);
            $("#btnEPDateAddress").attr('disabled', false);
            $("#txtEPDateAddress").attr('style','background:white;width:77%');
            $("#txtEPDateAddress").attr('readonly', false);
       }
    }
    $(document).ready(function () {  
        initTableTr();
        // LoadCourseLayout($("#LastAddress").val());
        initCheckSel();       
        var trReturn=$("#tbReturn tr");
        if(trReturn[0].outerText==""){
            $("#tbReturn").attr('style','display:none');
        }
        if($("#SaleRoad").val().indexOf('，')==-1){
            btnAddRow($("#PackName").val(),$("#txtMemember").val(),$("#Amount").val(),$("#SaleRoad").val(),$("#OneMoney").val(),$("#FactPayDate").val());
        }else{
            var tempArr=$("#SaleRoad").val().split('，');
            for (var i = 0; i < tempArr.length; i++) {
                if($("#OneMoney").val().indexOf('，')==-1){
                btnAddRow($("#PackName").val(),$("#txtMemember").val().split(',')[i],$("#Amount").val().split('，')[i],tempArr[i],$("#OneMoney").val().split('，')[0],$("#FactPayDate").val().split('，')[i]);
                }else{
                btnAddRow($("#PackName").val(),$("#txtMemember").val().split(',')[i],$("#Amount").val().split('，')[i],tempArr[i],$("#OneMoney").val().split('，')[i],$("#FactPayDate").val().split('，')[i]);}
            }
            
        }
        $('#PayDate').cld();
        $("#EPPayDate").cld();
        $("#txtAgainBuy").cld();
        $("#DeliverDate").cld();
    });
</script>
</html>
